import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import Login from './views/Login'
import Home from './views/Home'
import Detail from './views/Detail'
import { Router, Route, IndexRedirect, hashHistory } from 'react-router'
export default class App extends Component {
  render() {
    return <>
    {this.props.children}
    </>
  }
}
const router = (
  <Router history={hashHistory}>
    <Route path="/" component={App}>
      <IndexRedirect to="/login" />
      <Route path="/login" component={Login} />
      <Route path="/home" component={Home} />
      <Route path="/detail/:id" component={Detail} />
    </Route>
  </Router>
)
ReactDOM.render(router, document.getElementById('root'))
